﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SF.Common;

namespace SF.Ucenter.admin.dialog
{
    public partial class dialog_print : Web.UI.ManagePage
    {
        private string order_no = string.Empty;
        protected string appWhere = "";
        protected Model.sf_goods_order model = new Model.sf_goods_order();
        protected Model.manager adminModel = new Model.manager();
        protected Model.sf_user_info userModel = new Model.sf_user_info();
        protected Model.sf_user_address addressModel = new Model.sf_user_address();

        protected void Page_Load(object sender, EventArgs e)
        {
            order_no = DTRequest.GetQueryString("order_no");
            if (order_no == "")
            {
                JscriptMsg("传输参数不正确！", "back");
                return;
            }
            if (!new BLL.sf_goods_order().Exists(Convert.ToInt64(order_no)))
            {
                JscriptMsg("订单不存在或已被删除！", "back");
                return;
            }
            if (!Page.IsPostBack)
            {
                ShowInfo(Convert.ToInt64(order_no));
            }
        }

        #region 赋值操作=================================
        private void ShowInfo(long _order_no)
        {
            BLL.sf_goods_orderdetal detalBll = new BLL.sf_goods_orderdetal();
            BLL.sf_goods_order bll = new BLL.sf_goods_order();
            model = bll.GetModel(_order_no);
            appWhere = Utils.getWhereByInfo(model.busnieseNum,model.appNum,model.templatesNum);
            adminModel = GetAdminInfo();
            userModel = new BLL.sf_user_info().GetModelByNum(model.userNum,appWhere);
            orderId.Value = model.id.ToString();
            this.rptList.DataSource = detalBll.GetList(appWhere + " and orderNum='"+model.orderNum+"'");
            this.rptList.DataBind();
        }
        #endregion


        protected string getGoodsMsg(string goodsNum) 
        {
            return new BLL.sf_goods_info().GetModel(appWhere + " and goodsNum='" + goodsNum + "'").names;
        }
    }
}